package org.example.aaaatest.a11;

import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.util.Date;
import java.util.TimeZone;

/**
 * @description:
 * @author: wangbaogui
 * @create: 2025/4/9 09:44
 **/
public class aa {
    public static void main(String[] args) {
        TimeZone timeZone = TimeZone.getTimeZone("America/New_York");
        ZoneId targetZone = timeZone.toZoneId();
        Date originalDate = new Date();
        ZonedDateTime zonedDateTime = originalDate.toInstant()
                .atZone(ZoneOffset.UTC) // 强制 UTC 基准
                .withZoneSameInstant(targetZone);

        System.out.println("zonedDateTime = " + zonedDateTime);


    }
}
